﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CSharp.Libs.Net;
using Fiddler;
using CSharp.Libs.WPF;

namespace AmazonTaggerWPF
{
    class MainWindowViewModel : ViewModelBase
    {
        #region declarations
        private CSharp.Libs.Net.AmazonTagger _AT = null;

        private String _strFiddlerLog = "";
        #endregion



        #region constructor / terminator
        public MainWindowViewModel()
        {
            _AT = new CSharp.Libs.Net.AmazonTagger();

            FiddlerApplication.Log.OnLogString += new EventHandler<LogEventArgs>(Log_OnLogString);
        }

        ~MainWindowViewModel()
        {
        }
        #endregion



        #region event handling
        void Log_OnLogString(object sender, LogEventArgs e)
        {
            _strFiddlerLog = String.Concat(_strFiddlerLog, e.LogString, Environment.NewLine);
            OnPropertyChanged("FiddlerLog");
        }
        #endregion
        
        
        
        #region private functions
        #endregion



        #region interface
        #region properties
        public String FiddlerLog
        {
            get
            {
                return _strFiddlerLog;
            }
            set
            {
                _strFiddlerLog = value;
            }
        }
        #endregion

        #region methods
        #endregion
        #endregion
    }
}
